package com.zengqingfa.shardingDemo.spidemo;

import java.util.ServiceLoader;

/**
 * @author zengqingfa
 * @className Test
 * @description
 * @create 2022/6/12 16:59
 */
public class Test {
    public static void main(String[] args) {
        ServiceLoader<Animal> animals=ServiceLoader.load(Animal.class);
        /**
         *喵喵
         * 汪汪
         */
        animals.forEach(animal-> animal.noise());
    }
}